#! /usr/bin/env python
#coding:utf-8
#paramiko test!
""" demo.py command
"""

import paramiko
import os,sys

host='42.121.113.43'
user='root'
password='sharev@WH2013'
cmd=sys.argv[1]

s=paramiko.SSHClient()  #bind instance
s.load_system_host_keys()
#s.set_missing_host_key_policy(paramiko.AutoAddPolicy())

#connecting remote server;
s.connect(host,22,user,password,timeout=5)
stdin,stdout,stderr=s.exec_command(cmd)

cmd_result=stdout.read(),stderr.read()

for line in cmd_result:
    print line,

s.close()